
package com.oahcfly.chgame.util;

import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.utils.Align;
import com.oahcfly.chgame.core.Chao;

/** 封装了对Actor的常用操作。(坐标，缩放等)
 * 
 * @author haocao */
public class CHUIUtil {

	/** 让Actor处于屏幕正中间
	 * 
	 * @param actor */
	public static void toCenter (Actor actor) {
		anchorToCenter(actor);
		actor.setPosition(Chao.gameW / 2, Chao.gameH / 2, Align.center);
	}

	/** 将Actor的锚点设在中心
	 * 
	 * @param actor */
	public static void anchorToCenter (Actor actor) {
		actor.setOrigin(Align.center);
	}

}
